<% layout("/layouts/micro.html",{title:@Global.getConfig('productName')}){ %>
<div class="layui-layout layui-layout-admin kit-layout-admin">
    <div class="layui-header">
      <div class="layui-logo">${@Global.getConfig('productName')}</div>
      <div class="layui-logo kit-logo-mobile">M</div>
      <ul class="layui-nav layui-layout-left kit-nav" kit-one-level>
      </ul>
      <ul class="layui-nav layui-layout-right kit-nav">
      	<li class="layui-nav-item">
      		<a href="${ctxFront}" target="_blank"><i class="layui-icon">&#xe68e;</i> 主页</a>
      	</li>
        <li class="layui-nav-item">
          <a href="javascript:;">
            <i class="layui-icon">&#xe656;</i> 皮肤
          </a>
          <dl class="layui-nav-child skin">
            <dd><a href="javascript:;" data-skin="default" style="color:#393D49;"><i class="layui-icon">&#xe658;</i> 默认</a></dd>
            <dd><a href="javascript:;" data-skin="orange" style="color:#ff6700;"><i class="layui-icon">&#xe658;</i> 橘子橙</a></dd>
            <dd><a href="javascript:;" data-skin="green" style="color:#00a65a;"><i class="layui-icon">&#xe658;</i> 原谅绿</a></dd>
            <dd><a href="javascript:;" data-skin="pink" style="color:#FA6086;"><i class="layui-icon">&#xe658;</i> 少女粉</a></dd>
            <dd><a href="javascript:;" data-skin="blue.1" style="color:#00c0ef;"><i class="layui-icon">&#xe658;</i> 天空蓝</a></dd>
            <dd><a href="javascript:;" data-skin="red" style="color:#dd4b39;"><i class="layui-icon">&#xe658;</i> 枫叶红</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">
          <% var user = @UserUtils.getUser(); %>
            <span>${user.name}</span>
          </a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;" kit-target data-options="{url:'/sys/user/info',icon:'fa fa-address-book',title:'个人信息',id:'966'}"><i class="fa fa-user-secret" aria-hidden="true"></i><span>个人信息</span></a></dd>
            <dd><a href="javascript:;" kit-target data-options="{url:'/oa/oaNotify/self',icon:'fa-bell-o',title:'系统公告',id:'967'}"><i class="fa fa-bell-o" aria-hidden="true"></i><span>系统公告</span><span id="hasNewNotice" class="layui-badge-dot"></span></a></dd>
          </dl>
        </li>
        <li class="layui-nav-item"><a href="javascript:;" id="signOut"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
      </ul>
    </div>

    <div class="layui-side layui-bg-black kit-side">
      <div class="layui-side-scroll">
        <div class="kit-side-fold"><i class="fa fa-navicon" aria-hidden="true"></i></div>
        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree" lay-filter="kitNavbar" kit-navbar>
        </ul>
      </div>
    </div>
    <div class="layui-body" id="container">
      <!-- 内容主体区域 -->
      <div style="padding: 15px;"><i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63e;</i> 请稍等...</div>
    </div>

    <div class="layui-footer">
      <!-- 底部固定区域 -->
      <span>${@Global.getConfig('copyrightYear')} &copy; ${@Global.getConfig('productName')} —— Powered By <a href="#" target="_blank">thinkis</a> ${@Global.getConfig('version')}</span>　
      <span id="nowTime" style="float: right;"></span>
    </div>
  </div>
  <script>
    var message;
    layui.config({
      base: '${ctxStatic}/micro/src/js/',
      version: '1.0.1'
    }).use(['app', 'message'], function() {
      var app = layui.app,
        $ = layui.jquery,
        layer = layui.layer;
      	//将message设置为全局以便子页面调用
      	message = layui.message;
      	//主入口
		app.set({
	        type: 'iframe'
	      }).init();
      	
		$('dl.skin > dd').on('click', function() {
		  var $that = $(this);
		  var skin = $that.children('a').data('skin');
		  switchSkin(skin);
		});
		var setSkin = function(value) {
		    layui.data('kit_skin', {
		      key: 'skin',
		      value: value
		    });
		  },
		  getSkinName = function() {
		    return layui.data('kit_skin').skin;
		  },
		  switchSkin = function(value) {
		    var _target = $('link[kit-skin]')[0];
		    _target.href = _target.href.substring(0, _target.href.lastIndexOf('/') + 1) + value + _target.href.substring(_target.href.lastIndexOf('.'));
		    setSkin(value);
		
		  },
		  initSkin = function() {
		    var skin = getSkinName();
		    switchSkin(skin === undefined ? 'default' : skin);
		  }();
		  
		  $("#signOut").on('click',function(){
	    	 layer.confirm('是否退出系统吗？', {
		        btn: ['是','否'] //按钮
    	     }, function(){
		        window.location.href = ctx+"/logout";
	    	 });
		  })
    });
  	//获取系统时间
	var newDate = '';
	getLangDate();
	//值小于10时，在前面补0
	function dateFilter(date){
	    if(date < 10){return "0"+date;}
	    return date;
	}
	function getLangDate(){
	    var dateObj = new Date(); //表示当前系统时间的Date对象
	    var year = dateObj.getFullYear(); //当前系统时间的完整年份值
	    var month = dateObj.getMonth()+1; //当前系统时间的月份值
	    var date = dateObj.getDate(); //当前系统时间的月份中的日
	    var day = dateObj.getDay(); //当前系统时间中的星期值
	    var weeks = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
	    var week = weeks[day]; //根据星期值，从数组中获取对应的星期字符串
	    var hour = dateObj.getHours(); //当前系统时间的小时值
	    var minute = dateObj.getMinutes(); //当前系统时间的分钟值
	    var second = dateObj.getSeconds(); //当前系统时间的秒钟值
	    var timeValue = "" +((hour >= 12) ? (hour >= 18) ? "晚上" : "下午" : "上午" ); //当前时间属于上午、晚上还是下午
	    newDate = dateFilter(year)+"年"+dateFilter(month)+"月"+dateFilter(date)+"日 "+" "+dateFilter(hour)+":"+dateFilter(minute)+":"+dateFilter(second);
	    document.getElementById("nowTime").innerHTML = newDate+"　"+week;
	    setTimeout("getLangDate()",1000);
	}
  </script>
<%}%>